//
//  BeautifulEssayModel.m
//  JKFuYinProject
//
//  Created by jiukuyinyue on 2017/9/5.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "BeautifulEssayModel.h"

@implementation BeautifulEssayModel
///返回一个 Dict，将 Model 属性名对映射到 JSON 的 Key。
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"adddate" : @"update",
             @"id" : @[@"id",@"id_id"],
             @"id_id" : @[@"id",@"id_id"],
             };
}

/// Dic -> model
- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
    //    self.update = [LSZSpecialPackaging GetThePreviousTimeAndCompareItNow:dic[@"update"]];
    //    if (dic[@"id"] != nil && dic[@"id_id"] == nil) {
    //        self.id_id = dic[@"id"];
    //    }
    return YES;
}
///// model -> Dic
//- (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic {
////    dic[@"t"] = @([self.time timeIntervalSince1970] * 1000).description;
//    return YES;
//}

- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
- (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; }

- (NSUInteger)hash { return [self yy_modelHash]; }
- (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; }

- (NSString *)description { return [self yy_modelDescription]; }

+ (NSArray *)whc_IgnorePropertys {
    /// 下面是数据库存储的不兼容属性 忽略掉
    return @[@"update"];
}

+ (NSString *)whc_SqliteVersion {
    return @"1.0.3";
}
+ (NSString *)whc_SqlitePath {
    return [NSString stringWithFormat:@"%@/Documents/LCHomeWenDB/",NSHomeDirectory()];
}

@end
